package com.bt.lms.entity;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @author 李舒淇
 */
public class JdbcUtils {



    public static Connection jdbc ()  {

        //1.加驱动包
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
            //2.获取链接
            String url = "jdbc:mysql://rm-cn-zxu39exkm001edxo.rwlb.rds.aliyuncs.com:3306/bot_lms?serverTimezone=UTC";
            String userName = "root";
            String psw = "Bot-417-1";
            Connection connection = DriverManager.getConnection(url,userName,psw);
            return connection;
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);

        } catch (SQLException e) {
            throw new RuntimeException(e);
        }



    }

}
